/**
 * Created by IntelliJ IDEA
 *
 * @author zhengjie
 * @Date:2022/1/7 10:47
 * @Version 1.0
 */
package com.zj.ssm.result;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class AjaxResult {
    private Integer code;
    private String  msg;
    private Object  data;

    public static AjaxResult success(){
        return new AjaxResult(1,"成功",null);
    }
    public static AjaxResult success(Object data){
        return new AjaxResult(1,"成功",data);
    }
    public static AjaxResult fail(){
        return new AjaxResult(2,"失败",null);
    }
    public static AjaxResult  fail(String msg){
        return new AjaxResult(2,msg,null);
    }

}
